﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Model.ZSJL.com.Net
{
    /// <summary>
    /// 发送类型(密送或抄送)
    /// </summary>
    public enum SendType
    {
        Bcc,
        CC
    }

    /// <summary>
    /// 邮件
    /// </summary>
    public class EmailModel
    {
        private string host;        
        private string sendAddress;//发件人地址
        private string sendPwd;//发件人密码
        private string sendName;  //发件人姓名
        private string replyAddress;    //回复接收地址(一般为发件人,也可其他)
        private string replyName;//回复接收人
        private string subject;//标题
        private string receiverAddress;//收件人地址,群发支持" ," 隔开
        private string body;//正文

        #region 属性

        /// <summary>
        /// 邮件服务器地址
        /// </summary>
        public string Host
        {
            get { return host; }
            set { host = value; }
        }

        /// <summary>
        /// 发件人地址
        /// </summary>
        public string SendAddress
        {
            get { return sendAddress; }
            set { sendAddress = value; }
        }

        /// <summary>
        /// 发件人密码
        /// </summary>
        public string SendPwd
        {
            get { return sendPwd; }
            set { sendPwd = value; }
        }

        /// <summary>
        /// 发件人姓名
        /// </summary>
        public string SendName
        {
            get { return sendName; }
            set { sendName = value; }
        }
        /// <summary>
        /// 回复接收地址(一般为发件人,也可其他)
        /// </summary>
        public string ReplyAddress
        {
            get
            {
                if (string.IsNullOrEmpty(replyAddress))
                {
                    return SendAddress;
                }

                return replyAddress;
            }
            set { replyAddress = value; }
        }
        /// <summary>
        /// 回复接收人
        /// </summary>
        public string ReplyName
        {
            get
            {
                if (string.IsNullOrEmpty(replyName))
                {
                    return SendName;
                }

                return replyName;
            }
            set { replyName = value; }
        }
        /// <summary>
        /// /收件人地址,群发支持半角逗号" ," 隔开
        /// </summary>
        public string ReceiverAddress
        {
            get { return receiverAddress; }
            set { receiverAddress = value; }
        }
        /// <summary>
        /// 标题
        /// </summary>
        public string Subject
        {
            get { return subject; }
            set { subject = value; }
        }
        /// <summary>
        /// //正文
        /// </summary>
        public string Body
        {
            get { return body; }
            set { body = value; }
        }
        public string Attachment { get; set; }  //附件地址

        #endregion

    }
}
